Skip to main content

Plans

Base URL

All following endpoints operates over the URL of your store: https://your-store.com

example: https://alephdigital.publica.la

Endpoints
Create
Retrieve
Update

Headers

{
'Content-Type': 'application/json',
'Accept: 'application/json',
'X-User-Token': api_token,
}
info

Make sure you generated the api_token on your store. More info HERE

Create

POST /integration-api/v1/dashboard/plans

Body parameters

ParameterTypeDescription
typestringValid values: recurring, prepaid, Required
namestring
detailsstring
durationnullable, integer
recommendedboolean
privateboolean
assigns_collectionsboolean
concurrency_limitinteger
collectionslist of collections
download_filesboolean
priceslist of prices
free_trialboolean
free_trial_daysintegerThis field can be omitted when free_trial is False

Example of body parameters

{
"type":"recurring",
"name":"Demo Plan",
"details":"<div><!--block-->This is the description of the Demo Plan</div>",
"duration":null,
"recommended":true,
"private":false,
"assigns_collections":true,
"concurrency_limit":"1",
"collections":[
"Prepaid"
], // Check special considerations about collections ahead
"download_files":false,
"prices":{
"ARS":0,
"USD":"1",
"EUR":0,
"MXN":"1",
"COP":0,
"PEN":0,
"CLP":0,
"AUD":0,
"UYU":0,
"BOB":0,
"PYG":0,
"BRL":0,
"INR":0,
"GTQ":0,
"HNL":0
},
"free_trial":true,
"free_trial_days":"15"
}

Response

CodeDescriptio
201Object Created
422Validation error, the reason of the error will be described in the response

Assigning Collections

To assign collections to the new plan you may query the following endpoint to get available values for your the collections

GET /integration-api/v1/dashboard/plans/collections

Response Example

{"CODE": "success",
"data": ["Collection 1",
"Testing Collection 2",
"Demo Collection",
"Most Recent",
"Most Read",
"For Children"]}

Retrieve

GET /integration-api/v1/dashboard/plans/

Parameters

optiontypeendpoint
querystring, query parameter/integration-api/v1/dashboard/plans?query='Test Plan'
tip

Using query parameter you can search by name, type and details of the plans

Response

CodeDescription
200Success
404Object not found
401Unauthenticated

Response Example

{'CODE': 'success',
'data': {'assigns_collections': True,
'collections': ['Demo Collection 1', 'Demo Collection 2'],
'concurrency_limit': 1,
'created_at': '2021-05-21 15:34:36',
'customer': None,
'deleted_at': None,
'details': 'Este es un plan que servira de aula asociada a un '
'docente',
'download_files': 0,
'duration': 12,
'free_trial': 0,
'free_trial_days': 0,
'has_geolocalized_prices': False,
'id': 2696,
'name': 'Test Plan Name',
'prices': [],
'private': 1,
'recommended': False,
'type': 'prepaid',
'updated_at': '2021-05-21 15:34:36',
'url': 'https://unlimitedtestautomation.publicala.me/subscribe/2696?signature={random_hash}'}}

Update

PUT /integration-api/v1/dashboard/plans/{plan_id}

Body parameters

ParameterTypeDescription.
typestringValid values: recurring, prepaid, Required
namestring
detailsstring
durationnullable, integer
recommendedboolean
privateboolean
assigns_collectionsboolean
concurrency_limitinteger
collectionslist of collections
download_filesboolean
customerstring
invoicestring
file_namestring
upload_filefile
priceslist of prices
free_trialboolean
free_trial_daysintegerThis field can be omited when free_trial is False

Example of body parameters

{
"type":"recurring",
"name":"Demo Plan",
"details":"<div><!--block-->This is the description of the Demo Plan</div>",
"duration":null,
"recommended":true,
"private":false,
"assigns_collections":true,
"concurrency_limit":"1",
"collections":[
"Prepaid"
],
"download_files":false,
"customer":"",
"invoice":"",
"file_name":"",
"upload_file":false,
"prices":{
"ARS":0,
"USD":"1",
"EUR":0,
"MXN":"1",
"COP":0,
"PEN":0,
"CLP":0,
"AUD":0,
"UYU":0,
"BOB":0,
"PYG":0,
"BRL":0,
"INR":0,
"GTQ":0,
"HNL":0
},
"free_trial":true,
"free_trial_days":"15"
}

Response

CodeDesctiption
204Object Updated
422Validation error, the reason of the error will be described in the response
info

Same rules apply for assigning collections